/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-04-10
 * Time:15:32
 */
public class Person {
    public int data=10;
    private  int data2=20;

    //实例内部类
    class InnerClass{
        public int data = 40;

        //public static int data3=60； 无法定义静态成员变量
        public void textInner(){
            System.out.println("textInner");
        }
    }
    public static void main(String[] args) {
        //实例化内部类
        Person kk = new Person();
        Person.InnerClass fw = kk.new InnerClass();
        fw.textInner();    //输出结果为：textInner
        //实例化内部类
        Person.InnerClass fw1 =new Person().new InnerClass();
        fw1.textInner();    //输出结果为：textInner
    }
}

